package com.example.constants;

import org.springframework.util.ResourceUtils;

import java.io.FileNotFoundException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

//指令类型常量
//测试值
public class MyConstants {

    //1、指令码
    public static final String Merge_Instruct = "1";
    public static final String MergeUpdate_Instruct = "2";
    public static final String Split_Instruct = "3";
    public static final String AttrUpdate_Instruct = "4";

    //2、项目状态码
    public static final int SUCCESS = 200;
    public static final int FAILED = 500;
    public static final int VALIDATE_FAILED = 404;
    public static final int UNAUTHORIZED = 401;
    public static final int FORBIDDEN = 403;

    //3、本地仓库（图片、视频）,
    public static String picPath;
    public static String vdoPath;
    static {
        try {
            picPath = URLDecoder.decode(MyConstants.class.getClassLoader().getResource("").getPath() + "static/images/", "UTF-8");
            vdoPath = URLDecoder.decode(MyConstants.class.getClassLoader().getResource("").getPath() + "static/videos/", "UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
    }
}
